package com.info.zhiduoduo.repository.mapper.company;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.info.zhiduoduo.repository.dto.company.CompanyOfflineRechargeDetailDto;
import com.info.zhiduoduo.repository.entity.company.CompanyOfflineRechargeDetail;

import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author bob
 * @since 2020-04-06
 */
public interface CompanyOfflineRechargeDetailMapper extends BaseMapper<CompanyOfflineRechargeDetail> {

	@Select(" select cord.*,cor.compid,c.compname " +
			" from zdd_company_offline_recharge_detail cord " +
			" join zdd_company_offline_recharge cor on cor.id = cord.offline_recharge_id " +
			" join zdd_company c on c.compid = cor.compid " +
			" where cord.offline_recharge_id = #{id}")
	List<CompanyOfflineRechargeDetailDto> findDetailList(int id);

	@Select(" select cord.*,cor.compid,c.compname " +
			" from zdd_company_offline_recharge_detail cord " +
			" join zdd_company_offline_recharge cor on cor.id = cord.offline_recharge_id " +
			" where cord.id = #{rechargeDetailid}")
	CompanyOfflineRechargeDetailDto getRechargeDetail(int rechargeDetailid);
}
